# contrib/walminer/Makefile

MODULE_big	= walminer
OBJS		= pg_logminer.o logminer.o organizsql.o xlogreader_logminer.o datadictionary.o xlogminer_contents.o

EXTENSION = walminer
DATA = walminer--1.0.sql

TESTS        = $(wildcard sql/*.sql)
REGRESS      = $(patsubst sql/%.sql,%,$(TESTS))

#ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
PG_VERSION := $(shell $(PG_CONFIG) --version)

ifeq ($(findstring PostgreSQL 12,$(PG_VERSION)), PostgreSQL 12)
	PG_CPPFLAGS = -DPG_VERSION_12
endif

ifeq ($(findstring PostgreSQL 11,$(PG_VERSION)), PostgreSQL 11)
	PG_CPPFLAGS = -DPG_VERSION_11
endif

include $(PGXS)
#else
#subdir = contrib/walminer
#top_builddir = ../..
#include $(top_builddir)/src/Makefile.global
#include $(top_srcdir)/contrib/contrib-global.mk
#endif